home *** CD-ROM | disk | FTP | other *** search
- package sub_arctic.output;
-
-
- import sub_arctic.input.*;
- import sub_arctic.output.*;
-
- import java.awt.Font;
- import java.awt.Color;
-
- /**
- * This class holds onto information that the toolkit will need about
- * the current way to display the interface and other properties of
- * the interface w.r.t. display.
- * @author Ian Smith
- */
- public class style_manager {
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Store the current style. */
- static protected style _current_style;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Get the currently active style manager.
- *
- * @return style an instance of a style which will handle this interfaces
- * look and feel needs.
- */
- static public style current_style() {
- if (_current_style==null) {
- // XXX temporarily make motif always the default
- _current_style=new motif_style();
- }
- return _current_style;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Change the current style.
- *
- * @param style s the new style handler.
- */
- public static void set_current_style(style s) {
- _current_style=s;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** This is sub_arctic's default color scheme. */
- protected static color_scheme _default_scheme=null;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * This gets the default color scheme for sub_arctic, predominately
- * grey with a white text bg.
- *
- * @return color_scheme the system default scheme
- */
- static public color_scheme default_color_scheme() {
- if (_default_scheme==null) {
- /* build a Grey color scheme */
- _default_scheme=new color_scheme(Color.white, Color.black,
- new Color(153,153,153),
- new Color(191,191,191),
- new Color(115,115,115),
- new Color(230,230,230),
- new Color(178,77,122));
- }
- return _default_scheme;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Set the default color scheme. XXX This should force some kind
- * a global redraw of all interactors that use the style_manager.
- * @param color_scheme cs the new color scheme for the system.
- */
- static public void set_default_scheme(color_scheme cs) {
- _default_scheme=cs;
- /* tell the style what happened */
- current_style().color_scheme_changed();
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** The default font for the system. */
- static protected Font _default_font=new Font("Helvetica",Font.PLAIN, 12);
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Retrieve the default font.
- * @return Font the system's default font.
- */
- static public Font default_font() {
- return _default_font;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Set the default font. XXX Should trigger a refresh of all
- * objects using the style system. XXX
- * @param Font f the new system default font.
- */
- static public void set_default_font(Font f) {
- _default_font=f;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-